ShpTool = function()
{
 this.setImg = function(typeSDD, idForm, idFileInput, idDivPreview)
 {
  var formImg = $(idForm)[0];
  formImg.method = "post";
  formImg.enctype="multipart/form-data";
  formImg.action= "/AnGiang-557-portlet/html/baocao/UploadFile.jsp";
  var inputTextAlias = $(idFileInput)[0];
  inputTextAlias.accept = "image/*";
     
  $(inputTextAlias).live('change', function () {   
     });
  $(inputTextAlias).change(function () {
  }).change();
 };

 this.setDoc = function(typeSDD, idForm, idFileInput, idDivPreview)
 {
  var formImg = $(idForm)[0];
  formImg.method = "post";
  formImg.enctype="multipart/form-data";
  formImg.action= "/AnGiang-557-portlet/html/baocao/UploadFile.jsp";
  var inputTextAlias = $(idFileInput)[0];
  inputTextAlias.type = 'file';
     
  $(inputTextAlias).live('change', function () {   
     });
  $(inputTextAlias).change(function () {
  }).change();
 };
 
 this.readExcel = function(typeSDD, idForm, idFileInput, idDivPreview)
 {
  var formImg = $(idForm)[0];
  formImg.method = "post";
  formImg.enctype="multipart/form-data";
  formImg.action= "/AnGiang-557-portlet/html/drainwater/asset/khachhang.jsp";
  var inputTextAlias = $(idFileInput)[0];
  inputTextAlias.type = 'file';
     
  $(inputTextAlias).live('change', function () {   
     });
  $(inputTextAlias).change(function () {
  }).change();
 };
 
 this.importSHP = function(idForm, idDivPreview) {
  var divPreview = $(idDivPreview)[0];
  var formImg = $(idForm)[0];
        $(divPreview).html('');
        //$(divPreview).html('<img src="/AnGiang-557-portlet/css/images/animated.gif" alt="Uploading...."//>');
        $(divPreview).hide();
        $(formImg).ajaxForm({
            target: idDivPreview,
            success: function(msg){
             msg = base.trim(msg.replace(/(\r\n|\n|\r)/gm, ""));
             $(idDivPreview).html(msg);
             //alert("thành công");
                //enableMainPage();
           },
           error: function(XMLHttpRequest, textStatus, errorThrown) {
                 //enableMainPage();
           }
        }).submit();
 };
 
 this.importSHPExcel = function(idForm, idDivPreview) {
	  var divPreview = $(idDivPreview)[0];
	  var formImg = $(idForm)[0];
	        $(divPreview).html('');
	        $(divPreview).html('<img src="/AnGiang-557-portlet/css/images/animated.gif" alt="Uploading...."//>');
	        $(formImg).ajaxForm({
	            target: idDivPreview,
	            success: function(msg){
	             msg = base.trim(msg.replace(/(\r\n|\n|\r)/gm, ""));
	             $(idDivPreview).html(msg);
	           },
	           error: function(XMLHttpRequest, textStatus, errorThrown) {
	           }
	        }).submit();
	 };
};
var shptool = new ShpTool();